export default defineStore('system', {
  state: () => {
    return {
      isCollapse: false,
      windowWidth: 0,
      menus: [],
      btns: {}
    }
  },
  getters: {
    isPc: (state) => {
      // 对menu菜单兼容移动端处理
      state.isCollapse = state.windowWidth >= 768 && state.windowWidth < 976
      return state.windowWidth >= 768
    }
  },
  actions: {
    setIsCollapse (payload) {
      this.isCollapse = payload
    },
    setWindowWidth (width) {
      this.windowWidth = width
    },
    setMenus (menus) {
      this.menus = menus
    },
    setBtns (btns) {
      this.btns = btns
    }
  }
})
